/**
 * 计数器
 * @author zido
 * @since 2017/5/30 0030
 */
import React from 'react'
import PropTypes from 'prop-types'

import {Button} from 'antd'
class Counter extends React.Component {
  render() {
    const {counter, increase,doubleAsync} = this.props

    return (
      <div>
        <div>和：{counter}</div>
        <Button type={'primary'} onClick={increase}>同步增加</Button>
        <Button type={'primary'} style={{marginLeft:10}} onClick={doubleAsync}>异步*2</Button>
      </div>
    )
  }
}

Counter.propTypes = {
  counter:PropTypes.number.isRequired,
  increase:PropTypes.func.isRequired,
  doubleAsync:PropTypes.func.isRequired
}

export default Counter